]> dgit.raspbian.org Git - gnome-shell.git/log
gnome-shell.git
7 years agoextensionPrefs: Attach extension object to each row
Didier Roche [Thu, 1 Nov 2018 12:50:30 +0000 (13:50 +0100)]
extensionPrefs: Attach extension object to each row

Each row represents an extension, so it makes sense to associate the
rows with the actual extensions instead of linking rows and extensions
by looking up the UUID in the external extensions map in ExtensionUtils.

This will also make it much easier to stop using the shared extension
loading / map in favor of the extension D-Bus API.

https://bugzilla.gnome.org/show_bug.cgi?id=789852

7 years agoextensionSystem: Add canChange property to extensions
Didier Roche [Tue, 4 Dec 2018 08:31:27 +0000 (09:31 +0100)]
extensionSystem: Add canChange property to extensions

Whether or not an extension can be enabled/disabled depends on various
factors: Whether the extension is in error state, whether user extensions
are disabled and whether the underlying GSettings keys are writable.

This is complex enough to share the logic, so add it to the extension
properties that are exposed over D-Bus.

https://bugzilla.gnome.org/show_bug.cgi?id=789852

7 years agoshellDBus: Add new 'ExtensionStateChanged' signal
Florian Müllner [Mon, 8 Jul 2019 10:21:10 +0000 (12:21 +0200)]
shellDBus: Add new 'ExtensionStateChanged' signal

The existing 'ExtensionStatusChanged' signal has a fixed set of parameters,
which means we cannot add additional state without an API break.  Deprecate
it in favor of a new 'ExtensionStateChanged' signal which addresses this
issue by taking the full serialized extension as parameter.

https://bugzilla.gnome.org/show_bug.cgi?id=789852

7 years agoextensionUtils: Add functions to (de)serialize extensions
Didier Roche [Thu, 1 Nov 2018 12:55:17 +0000 (13:55 +0100)]
extensionUtils: Add functions to (de)serialize extensions

Serializing an extension for sending over D-Bus is currently done by the
appropriate D-Bus method implementations. Split out the code as utility
function and add a corresponding deserialization function, which we will
soon use when consuming the D-Bus extension API from the extension-prefs
tool.

https://bugzilla.gnome.org/show_bug.cgi?id=789852

7 years agoextensionSystem: Add methods to enable/disable extensions
Didier Roche [Wed, 17 Jan 2018 12:43:11 +0000 (13:43 +0100)]
extensionSystem: Add methods to enable/disable extensions

Extensions are currently enabled or disabled by directly changing the
list in the 'enabled-extensions' GSettings key. As we will soon add
an overriding 'disabled-extensions' key as well, it makes sense to
offer explicit API for enabling/disabling to avoid duplicating the
logic.

For the corresponding D-Bus API, the methods were even mentioned in
the GSettings schema, albeit unimplemented until now.

https://bugzilla.gnome.org/show_bug.cgi?id=789852

7 years agoextensionSystem: Make methods to call extension functions private
Florian Müllner [Mon, 8 Jul 2019 00:53:32 +0000 (02:53 +0200)]
extensionSystem: Make methods to call extension functions private

While public methods to enable/disable extensions make sense for an
extension manager, the existing ones are only used internally. Make
them private and rename them, so that we can re-use the current
names for more useful public methods.

https://bugzilla.gnome.org/show_bug.cgi?id=789852

7 years agoextensionSystem: Turn into a class
Florian Müllner [Thu, 7 Mar 2019 00:45:45 +0000 (01:45 +0100)]
extensionSystem: Turn into a class

The extension system started out as a set of simple functions, but
gained more state later, and even some hacks to emit signals without
having an object to emit them on.

There is no good reason for that weirdness, so rather than imitating an
object, wrap the existing system into a real ExtensionManager object.

https://bugzilla.gnome.org/show_bug.cgi?id=789852

7 years agoextensionUtils: Move ExtensionState definition here
Florian Müllner [Sat, 6 Jul 2019 13:31:57 +0000 (15:31 +0200)]
extensionUtils: Move ExtensionState definition here

It makes sense to keep extension-related enums in the same module instead
of spreading them between ExtensionSystem and ExtensionUtils.

More importantly, this will make the type available to the extensions-prefs
tool (which runs in a different process and therefore only has access to
a limited set of modules).

https://bugzilla.gnome.org/show_bug.cgi?id=789852

7 years agobuild: Clean out unused version requirements
Florian Müllner [Sat, 20 Jul 2019 10:38:04 +0000 (12:38 +0200)]
build: Clean out unused version requirements

We haven't linked to those libraries in years ...

7 years agobackground: Adjust to gnome-desktop API break
Florian Müllner [Sat, 20 Jul 2019 10:11:55 +0000 (12:11 +0200)]
background: Adjust to gnome-desktop API break

gnome-desktop broke API in commit ca5d61cf24, as it didn't *add* a property
as incorrectly stated in the commit message, but *replaced* an existing one.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1457

7 years agomain: Avoid missing braces warnings when compiling with clang
Ting-Wei Lan [Sat, 20 Jul 2019 08:28:53 +0000 (16:28 +0800)]
main: Avoid missing braces warnings when compiling with clang

Since -Werror=missing-braces is used, having missing braces warnings
aren't allowed. However, the first member of struct sigaction is a union
whose first member is a pointer, causing clang to produce warnings when
it is initialized to { 0 }.

Instead of initializing to a zero value, we can specify values of
members directly in the initializer to avoid warnings.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/633

7 years agopower: Make sure we fall back to the correct icon
Florian Müllner [Mon, 15 Jul 2019 22:37:13 +0000 (00:37 +0200)]
power: Make sure we fall back to the correct icon

Commit bd18313d12 changed to a new naming scheme for battery icons,
and used to old icon names as fallback-icon-name for compatibility
with older/other icon themes.

However that fallback code isn't working correctly, as GThemedIcon's
default fallbacks will transform a name of `battery-level-90-symbolic`
to a list of names:
 - `battery-level-90-symbolic`
 - `battery-level-symbolic`
 - `battery-symbolic`

The last one frequently exists, so instead of the intended fallback,
we end up with a generic battery icon.

Address this by specifying the icon as GIcon instead of an icon-name,
where we have more control over how the icon is resolved.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1442

7 years agoshell: Don't use g_memmove()
Florian Müllner [Wed, 17 Jul 2019 15:20:08 +0000 (17:20 +0200)]
shell: Don't use g_memmove()

Glib stopped providing any fallback implementations on systems without
memmove() all the way back in 2013. Since then, the symbol is a simple
macro around memmove(); use that function directly now that glib added
a deprecation warning.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/632

7 years agoworkspacesView: Support horizontal layout
Florian Müllner [Tue, 4 Jun 2019 19:49:23 +0000 (19:49 +0000)]
workspacesView: Support horizontal layout

Just as we did for the workspace switcher popup, support workspaces
being laid out in a single row in the window picker.

Note that this takes care of the various workspace switch actions in
the overview (scrolling, panning, touch(pad) gestures) as well as the
switch animation, but not of the overview's workspace switcher component.

There are currently no plans to support other layouts there, as the
component is inherently vertical (in fact, it was the whole reason for
switching the layout in the first place).

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/575

7 years agoworkspaceSwitcherPopup: Support horizontal layout
Florian Müllner [Tue, 4 Jun 2019 19:22:26 +0000 (19:22 +0000)]
workspaceSwitcherPopup: Support horizontal layout

While mutter supports a variety of different grid layouts (n columns/rows,
growing vertically or horizontally from any of the four corners), we
hardcode a fixed vertical layout of a single column.

Now that mutter exposes the actual layout to us, add support for a more
traditional horizontal layout as well.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/575

7 years agotheme: app icon helper tweaks
Jakub Steiner [Thu, 18 Jul 2019 03:03:08 +0000 (05:03 +0200)]
theme: app icon helper tweaks

Shell cannot composite multiple shadows, simplify to only use one.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/168

7 years agoextensionPrefs: Inherit from Gtk.Application
Marco Trevisan (Treviño) [Tue, 28 May 2019 21:22:37 +0000 (23:22 +0200)]
extensionPrefs: Inherit from Gtk.Application

Extension preferences Application class is just a container for a GtkApplication
so instead of using composition we can inherit from the base GObject class.

Also replace signal connections with vfunc's.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/631

7 years agotheme: make overview thumbnails rounder
Jakub Steiner [Tue, 16 Jul 2019 03:27:34 +0000 (05:27 +0200)]
theme: make overview thumbnails rounder

- match gtk Adwaita

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/1449

7 years agotheme: unbreak acrive states for icon tiles
Jakub Steiner [Mon, 15 Jul 2019 22:16:32 +0000 (00:16 +0200)]
theme: unbreak acrive states for icon tiles

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/1446

7 years agotheme: Provide icon helper classes
Jakub Steiner [Mon, 15 Jul 2019 22:04:48 +0000 (00:04 +0200)]
theme: Provide icon helper classes

- to help present icons on light backgrounds, the new fullcolor
  icons need some help. Mimic gtk styles

Needed for https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/168

7 years agoUpdate Karbi translation
Jor Teron [Tue, 16 Jul 2019 02:39:07 +0000 (02:39 +0000)]
Update Karbi translation

7 years agosearch: Remove wrong additional argument for _createResultDisplay
Jonas Dreßler [Tue, 9 Jul 2019 15:17:06 +0000 (17:17 +0200)]
search: Remove wrong additional argument for _createResultDisplay

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/110

7 years agoiconGrid: Make sure the style is updated before computing the layout
Jonas Dreßler [Sat, 24 Nov 2018 23:57:00 +0000 (00:57 +0100)]
iconGrid: Make sure the style is updated before computing the layout

In some cases the style-changed signal hasn't been emitted when
_computeLayout() is called, resulting in the use of the default spacing
and item size values for the calculations.

One case where this happens is when starting a search. Right after the
initialization of GridSearchResults, _computeLayout() is called from
_getMaxDisplayedResults() and the style-changed signal hasn't been
emitted yet. The computed layout will be wrong and the maximum
number of results will also be wrong.

To prevent this from happening, make sure the style has been updated
before doing the calculations in _computeLayout().

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/110

7 years agosearch: Fix calculation of max number of displayed results for grid
Jonas Dreßler [Sat, 24 Nov 2018 23:57:00 +0000 (00:57 +0100)]
search: Fix calculation of max number of displayed results for grid

The calculation of how many results can be shown in GridSearchResults is
broken: The width of the parent container (resultsView.actor) we're
using as the maximum width right now is the width of the scrollView of
SearchResults (which always expands to the whole screen size). This
width will only be correct if the scrollView (ie. the whole screen) is
smaller than the max width of searchResultsContent, which only is the
case for screens smaller than 1000px.

To fix the calculation, use the width of our own actor and don't get it
using clutter_actor_get_width(), but using the last allocation of the
actor. This way we don't get the preferred width if the actor is not
allocated at this point (it's hidden by _ensureProviderDisplay() when
starting a new search).

Then, when the allocation of the actor changes, rebuild the grid search
results by calling updateSearch() with the old arguments to ensure the
number of visible results is correct. The fact that we're only listening
for allocation changes here is the reason why we never want to use the
preferred width of the actor inside _getMaxDisplayedResults(): While
the actor is hidden clutter_actor_get_width() would return the preferred
width, which we'd then use the as the maximum width. But if the actor
had a correct allocation before, no notify::allocation signal will be
emitted when the actor is shown again because the allocation is still
the same, and we'll end up using the preferred width as maximium width
forever.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/110

7 years agotheme: Don't apply overlap-preventing padding to search results
Jonas Dreßler [Sat, 24 Nov 2018 21:42:51 +0000 (22:42 +0100)]
theme: Don't apply overlap-preventing padding to search results

Unlike the app grid, we show the search results while the dash is hidden
and with a small scrollbar instead of page indicator dots. This
means there's nothing the search results might horizontally overlap
with and the padding here is unneccessary.

The spacing between the search results and the screen edges is still
sufficient because of the paddings applied to searchResultsContent.

On very small screens (< 1000px), this allows the search results to
utilize a lot more of the horizontal screen space.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/110

7 years agosearch: Remove unnecessary containers
Jonas Dreßler [Sat, 24 Nov 2018 21:33:05 +0000 (22:33 +0100)]
search: Remove unnecessary containers

The functionality the searchResultsBin container provides can easily be
moved into a subclass of St.BoxLayout, no need for an additional StBin.
The "searchResultsBin" css class isn't used in the stylesheets either.

Same with the scrollChild container.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/110

7 years agoUpdate Karbi translation
Jor Teron [Mon, 15 Jul 2019 10:54:50 +0000 (10:54 +0000)]
Update Karbi translation

7 years agoshellDBus: Rename ShowMonitorLabels2 to ShowMonitorLabels
Benjamin Berg [Thu, 11 Apr 2019 17:43:35 +0000 (19:43 +0200)]
shellDBus: Rename ShowMonitorLabels2 to ShowMonitorLabels

The original ShowMonitorLabels has been removed so we can change things
back to use ShowMonitorLabels again.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/491

7 years agoAdd Karbi translation
Jor Teron [Sun, 14 Jul 2019 04:02:53 +0000 (04:02 +0000)]
Add Karbi translation

7 years agopower: Use more fine-grained battery levels
Florian Müllner [Tue, 28 May 2019 17:56:36 +0000 (17:56 +0000)]
power: Use more fine-grained battery levels

Adwaita-icon-theme added new battery icons which represent battery levels
in 10% steps[0]. Use these if they are available, otherwise fall back to
the existing icon names for compatibility with older icon themes.

[0] https://gitlab.gnome.org/GNOME/adwaita-icon-theme/issues/6

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/561

7 years agocalendar: Simplify code a bit
Florian Müllner [Fri, 12 Jul 2019 03:25:54 +0000 (05:25 +0200)]
calendar: Simplify code a bit

Just make the error case the same as the no-appointments one.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/626

7 years agocalendar: Avoid a warning
Florian Müllner [Fri, 12 Jul 2019 03:25:54 +0000 (05:25 +0200)]
calendar: Avoid a warning

We will always get a results array from gjs' proxy wrapper, but it
will be empty in the error case; that is, `results` is always defined,
but `results[0]` may not be.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/626

7 years agodialog: Use Object.assign() for default property value
Florian Müllner [Sat, 29 Jun 2019 23:03:46 +0000 (01:03 +0200)]
dialog: Use Object.assign() for default property value

Either Params.parse() or Object.assign() are more concise for providing
default values in object literals (sadly default parameters won't work
here).

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/626

7 years agocleanup: Use default parameters where appropriate
Florian Müllner [Thu, 11 Jul 2019 23:31:38 +0000 (01:31 +0200)]
cleanup: Use default parameters where appropriate

Since ES6 it is possible to set an explicit default value for optional
parameters (overriding the implicit value of 'undefined'). Use them
for a nice small cleanup.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/626

7 years agopanel: Relax check for existing signal handler
Florian Müllner [Sat, 29 Jun 2019 23:04:32 +0000 (01:04 +0200)]
panel: Relax check for existing signal handler

Object.prototype.hasOwnProperty() is more precise than checking for
falsiness, for instance the following is true:

  { foo: undefined }.hasOwnProperty('foo');

However when checking for a handler ID, a more relaxed check is more
appropriate, as particularly 0 is not a valid handler ID.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/626

7 years agocleanup: Don't call method via a parent's prototype
Florian Müllner [Tue, 24 Jul 2018 09:49:00 +0000 (11:49 +0200)]
cleanup: Don't call method via a parent's prototype

We cannot disconnect a signal handler via the usual disconnect() as
nm_device_disconnect() shadows the GObject method, but we can use
g_signal_handler_disconnect().

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/626

7 years agolint: Add "legacy" configuration
Florian Müllner [Mon, 28 Jan 2019 00:45:10 +0000 (01:45 +0100)]
lint: Add "legacy" configuration

Regarding coding style, gjs is moving in a direction that departs quite
significantly from the established style, in particular when indenting
multi-line array/object literals or method arguments:

Currently we are keeping those elements aligned, while the gjs rules now
expect them to use the regular 4-space indentation.

There are certainly good arguments that can be made for that move - it's
much less prone to leading to overly-long lines, and matches popluar JS
styles elsewhere. But switching coding style implies large diffs which
interfere with git-blame and friends, so in order to allow for a more
gradual change, add a separate set of "legacy" rules that match more
closely the style we would expect up to now.

It also disables the rules for quotes and template strings - the former
because we cannot match the current style to use double-quotes for
translatable strings and single-quotes otherwise, the latter because
template strings are still relatively new, so we haven't adopted them
yet.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/609

7 years agolint: Allow multiple spaces before key values
Florian Müllner [Mon, 28 Jan 2019 00:40:51 +0000 (01:40 +0100)]
lint: Allow multiple spaces before key values

This is useful for imitating namespaced flags/enums:

```
const FooFlags = {
    NONE:    0,
    SMEAGLY: 1 << 0,
    SMOGLEY: 1 << 1,
    MUGGLY:  1 << 2
};
```

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/609

7 years agolint: Enforce camelCase
Florian Müllner [Mon, 28 Jan 2019 04:52:24 +0000 (05:52 +0100)]
lint: Enforce camelCase

All variables should be in camelCase, so configure the corresponding
rule to enforce this. Exempt properties for now, to accommodate the
existing practice of using C-style underscore names for construct
properties of introspected objects.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/609

7 years agolint: Enforce arrow notation
Florian Müllner [Mon, 28 Jan 2019 00:39:54 +0000 (01:39 +0100)]
lint: Enforce arrow notation

We replaced all Lang.bind() calls with arrow functions or the standardized
Function.prototype.bind(), at least for the former eslint has some options
to ensure that the old custom doesn't sneak back in.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/609

7 years agolint: Require spaces inside braces in object literals
Florian Müllner [Sun, 27 Jan 2019 21:25:30 +0000 (22:25 +0100)]
lint: Require spaces inside braces in object literals

Prohibiting spaces where the established GNOME style has required
them for a decade would be a harsh change for no good reason.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/609

7 years agolint: Tweak the whitelist of globals
Florian Müllner [Sun, 27 Jan 2019 00:15:31 +0000 (01:15 +0100)]
lint: Tweak the whitelist of globals

gjs doesn't include any gettext wrappers, and obviously can't know
about the shell's global object, so include those in the list of
globals for all sources in the gnome-shell context.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/609

7 years agolint: Import eslint rules from gjs
Florian Müllner [Sat, 26 Jan 2019 23:15:39 +0000 (00:15 +0100)]
lint: Import eslint rules from gjs

gjs started to run eslint during its CI a while ago, so there is an
existing rules set we can use as a starting point for our own setup.

As we will adapt those rules to our code base, we don't want those
changes to make it harder to synchronize the copy with future gjs
changes, so include the rules from a separate file rather than using
the configuration directly.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/609

7 years agoworkspacesView: Work around spurious allocation changes
Florian Müllner [Fri, 12 Jul 2019 03:26:51 +0000 (03:26 +0000)]
workspacesView: Work around spurious allocation changes

For some reason, people are still seeing those after commit d5ebd8c8.
While this is something we really should figure out, we can work around
the issue by keeping the view actors hidden until the update is complete.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1065

7 years agocleanup: Remove bogus file
Florian Müllner [Fri, 12 Jul 2019 10:34:26 +0000 (10:34 +0000)]
cleanup: Remove bogus file

This was accidentally added in commit 14d7897a9.

7 years agolayout: Fix off-by-one indent
Florian Müllner [Thu, 11 Jul 2019 01:01:40 +0000 (03:01 +0200)]
layout: Fix off-by-one indent

This sneaked into commit dbb71f0d :-(

7 years agoparams: Don't use Lang module
Florian Müllner [Fri, 5 Jul 2019 21:36:30 +0000 (23:36 +0200)]
params: Don't use Lang module

To copy the passed in default parameters, we can just as well use
another Object.assign() call.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/616

7 years agoappDisplay: Fix logic error
Florian Müllner [Wed, 10 Jul 2019 20:52:09 +0000 (22:52 +0200)]
appDisplay: Fix logic error

Commit f6b4b96737d3 accidentally swapped the conditions here from
!includes() to includes().

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/621

7 years agoworkspace: Set offscreen redirect on window previews
Florian Müllner [Tue, 13 Nov 2018 16:24:37 +0000 (17:24 +0100)]
workspace: Set offscreen redirect on window previews

Window previews are sometimes shown translucent, for example during
drags or animations. They can also have attached dialogs, in which
case the opacity should affect the combination of all windows instead
of being applied to each window individually, blended together, so
make sure they are redirected as a whole when necessary.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/774

7 years agoworkspace: Let WindowClone inherit from StWidget
Florian Müllner [Wed, 14 Nov 2018 18:26:33 +0000 (19:26 +0100)]
workspace: Let WindowClone inherit from StWidget

Using inheritance over delegation will give us more control over
the actor drawing.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/774

7 years agolayout: Make the hot corner optional
Florian Müllner [Thu, 8 Jun 2017 15:07:56 +0000 (17:07 +0200)]
layout: Make the hot corner optional

Whether people love or hate the hot corner depends in large extents
on hardware sensitivity and habits, which is hard to get right
universally. So bite the bullet and support an option to enable or
disable hot corners ...

https://bugzilla.gnome.org/show_bug.cgi?id=688320

7 years agowindowManager: Remove unused property
Florian Müllner [Tue, 9 Jul 2019 12:46:36 +0000 (14:46 +0200)]
windowManager: Remove unused property

The last commit removed the only code that set _blockAnimations,
so stop reading it as well.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/620

7 years agowindowManager: Use new reorder_workspace() API
Florian Müllner [Mon, 8 Jul 2019 22:11:06 +0000 (00:11 +0200)]
windowManager: Use new reorder_workspace() API

With the new Mutter API, inserting a workspace at a particular position
becomes as easy as creating the workspace and moving it to the desired
index.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/620

7 years agoworkspaceThumbnails: Handle reordering of workspaces
Florian Müllner [Tue, 9 Jul 2019 12:26:12 +0000 (14:26 +0200)]
workspaceThumbnails: Handle reordering of workspaces

MetaWorkspaceManager gained the ability to reorder workspaces, so make
sure to pick up the new order when that happens.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/620

7 years agoworkspacesView: Handle reordering of workspaces
Florian Müllner [Tue, 9 Jul 2019 12:03:22 +0000 (14:03 +0200)]
workspacesView: Handle reordering of workspaces

MetaWorkspaceManager gained the ability to reorder workspaces, so make
sure to pick up the new order when that happens.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/620

7 years agoshell-recorder: Restore cursor recording
Illya Klymov [Mon, 8 Jul 2019 03:29:36 +0000 (03:29 +0000)]
shell-recorder: Restore cursor recording

Due to changes introduced in 5357e0a1 cursor recording interaction with
magnifier was reversed. This fix restores original correct behavior
Related issue: https://gitlab.gnome.org/GNOME/gnome-shell/issues/1208

7 years agocleanup: Fix style nits in last commit
Florian Müllner [Mon, 8 Jul 2019 18:14:35 +0000 (20:14 +0200)]
cleanup: Fix style nits in last commit

Missing space after catch and wrong double quotes.

7 years agoendSessionDialog: Check for PackageKit before considering updates/upgrades
Mario Sanchez Prada [Mon, 8 Jul 2019 06:51:36 +0000 (08:51 +0200)]
endSessionDialog: Check for PackageKit before considering updates/upgrades

GNOME Shell is spitting out some errors in the journal due to its attempts
to speak to PackageKit, which is not present on Endless OS, so let's add
some runtime checks to make sure that PackageKit is actually available
before assuming so and using its proxy to decide which kind of UI to
show to the user when ending the session.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/369

7 years agoshellDBus: Update ::accelerator-activated handler arguments
Carlos Garnacho [Mon, 8 Jul 2019 09:44:12 +0000 (11:44 +0200)]
shellDBus: Update ::accelerator-activated handler arguments

Mutter now passes a ClutterInputDevice. And use this to pass the
device ID (as we used to do) and the event node (so we can transition
to something that works on x11/wayland)

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/618

7 years agost: Consider non-background properties for ::style-changed
Florian Müllner [Wed, 1 May 2019 10:34:00 +0000 (12:34 +0200)]
st: Consider non-background properties for ::style-changed

st_theme_node_paint_equal() was originally added to preserve paint state
when a style change didn't affect any of StWidget's cached background
resources.
That's why using it for filtering out unneeded style changes as in commit
f662864a misses any non-background related properties that are relevant
for subclasses. Add additional tests to make sure we keep emitting the
signal in those cases.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1212

7 years agost: Add st_icon_colors_equal()
Florian Müllner [Thu, 2 May 2019 18:27:05 +0000 (20:27 +0200)]
st: Add st_icon_colors_equal()

This is a small convenience wrapper around clutter_color_equal()
for the different color components, which also handles the case
where one (or both) of the icon colors are %NULL.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/1212

7 years agoparams: Fix regression
Florian Müllner [Fri, 5 Jul 2019 16:10:56 +0000 (18:10 +0200)]
params: Fix regression

The first parameter to Object.assign() is the same target object that
will be returned. That is, since commit 46874eed0 Params.parse() modifies
the @defaults object. Usually we pass that parameter as an object literal
and this isn't an issue, but the change breaks spectacularly in the few
cases where we use a re-usable variable.

Restore the previous behavior by copying the object first.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/615

7 years agotests: Add Params.parse() unit tests
Florian Müllner [Fri, 5 Jul 2019 15:52:37 +0000 (17:52 +0200)]
tests: Add Params.parse() unit tests

Commit 46874eed0 accidentally changed the behavior of the function in
an incompatible way. Before addressing the actual issue, add a reproducer
to the unit tests to hopefully prevent future breakage.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/615

7 years agocleanup: Prefer template strings
Florian Müllner [Wed, 30 Jan 2019 00:18:24 +0000 (01:18 +0100)]
cleanup: Prefer template strings

Template strings are much nicer than string concatenation, so use
them where possible; this excludes translatable strings and any
strings containing '/' (until we can depend on gettext >= 0.20[0]).

[0] https://savannah.gnu.org/bugs/?50920

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/612

7 years agoparams: Simplify code
Florian Müllner [Tue, 2 Jul 2019 03:24:29 +0000 (05:24 +0200)]
params: Simplify code

Standard javascript now has Object.assign() which is very similar to
Params.parse(), except that the latter by default disallows "extra"
parameters. We can still leverage the standard API by simply
implementing the error check, and then call out to Object.assign()
for the actual parameter merging.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/612

7 years agoibusManager: Use Map to store engines
Florian Müllner [Sat, 29 Jun 2019 23:02:34 +0000 (01:02 +0200)]
ibusManager: Use Map to store engines

This is a clear case of key->value mapping, so using the corresponding
data type makes sense.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/612

7 years agost/button: Ungrab device before calling st_button_release
Jonas Dreßler [Thu, 4 Jul 2019 15:33:06 +0000 (17:33 +0200)]
st/button: Ungrab device before calling st_button_release

Since priv->device gets set to NULL inside st_button_release, ungrab the
input device before calling st_button_release and avoid
clutter_input_device_ungrab failing with a critical error.

This fixes a regression introduced with
d5a1a888d91b9456632a8393cf14c443e6df6a5b

While at it, also remove the superfluous line resetting priv->device to
NULL and move the check for priv->grabbed into an elseif block since
there should be no case where StButton has both grabs at the same time.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/614

7 years agoshell: Drop XDND initialization code
Carlos Garnacho [Wed, 3 Jul 2019 14:28:00 +0000 (16:28 +0200)]
shell: Drop XDND initialization code

Let mutter take over this, and drop this piece of backend-specific
code.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/611

7 years agoOSK variables and key rounding
frederik.feichtmeier [Tue, 2 Jul 2019 18:29:40 +0000 (14:29 -0400)]
OSK variables and key rounding

- generate the OSK key colors from variables in _colors.scss without changing the design
- add hover and active colors for all key, not only letter keys
- use $button_radius for the OSK keys, buttons and entries (no value change for the latter)

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/610

7 years agostyle: Stop using braces for single-line arrow functions
Florian Müllner [Mon, 28 Jan 2019 00:42:00 +0000 (01:42 +0100)]
style: Stop using braces for single-line arrow functions

Braces are optional for single-line arrow functions, but there's a
subtle difference:
Without braces, the expression is implicitly used as return value; with
braces, the function returns nothing unless there's an explicit return.

We currently reflect that in our style by only omitting braces when the
function is expected to have a return value, but that's not very obvious,
not an important differentiation to make, and not easy to express in an
automatic rule.

So just omit braces consistently as mandated by gjs' coding style.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/608

7 years agostyle: Fix indentation errors
Florian Müllner [Tue, 29 Jan 2019 19:36:54 +0000 (20:36 +0100)]
style: Fix indentation errors

While we have some style inconsistencies - mostly regarding split lines,
i.e. aligning to the first arguments vs. a four-space indent - there are
a couple of places where the spacing is simply wrong. Fix those.

Spotted by eslint.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/608

7 years agocleanup: Use arrow functions for tweener callbacks
Florian Müllner [Sat, 29 Jun 2019 15:37:59 +0000 (17:37 +0200)]
cleanup: Use arrow functions for tweener callbacks

While it is legal to use method syntax for the function properties
here, arrow notation is less unexpected and allows us to drop the
separate scope properties.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/608

7 years agocleanup: Use consistent switch indentation
Florian Müllner [Fri, 1 Feb 2019 12:21:00 +0000 (13:21 +0100)]
cleanup: Use consistent switch indentation

We are currently inconsistent on whether case labels share the same
indentation level as the corresponding switch statement or not. gjs
goes with the default of no additional indentation, so go along with
that.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/608

7 years agocleanup: Use spaces for indentation
Florian Müllner [Tue, 29 Jan 2019 20:18:46 +0000 (21:18 +0100)]
cleanup: Use spaces for indentation

Our indentation style has always mandated spaces, but over the years
some tabs sneaked in. Fix up those places.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/608

7 years agocleanup: Use consistent style for GObject property definitions
Florian Müllner [Tue, 29 Jan 2019 18:15:23 +0000 (19:15 +0100)]
cleanup: Use consistent style for GObject property definitions

Go with the style preferred by gjs.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/608

7 years agosystemActions: Reindent action map
Florian Müllner [Mon, 4 Feb 2019 12:28:22 +0000 (13:28 +0100)]
systemActions: Reindent action map

Starting an object literal with a comment throws off eslint's rules
for brace style (newline between brace and properties for both opening
and closing brace or neither) as well as indentation (fixed four-space
indent or align with the previous argument).

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/608

7 years agodwellClick: Reindent modes map
Florian Müllner [Sat, 29 Jun 2019 13:06:53 +0000 (15:06 +0200)]
dwellClick: Reindent modes map

Using multiple spaces after property names in order to align the
values isn't something we do elsewhere.

Instead, align the values by using a fixed 4-space indent as preferred
by gjs nowadays.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/608

7 years agoextensionPrefs: Avoid awkward indentation in string literal
Florian Müllner [Tue, 12 Feb 2019 14:16:08 +0000 (15:16 +0100)]
extensionPrefs: Avoid awkward indentation in string literal

The current code is carefully avoiding an overly wide line length as
well as adding literal new lines to the string due to indentation. It's
clever and barely legible.

Instead, use one string per line similar to how they appear in the actual
output, and join them together when setting the clipboard text.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/608

7 years agotests: Stop using global grabs
Jonas Dreßler [Sun, 14 Apr 2019 16:32:58 +0000 (18:32 +0200)]
tests: Stop using global grabs

Global grabs are being removed from Clutter in favour of input device
grabs.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/495

7 years agost: Replace global grabs with input device grabs
Jonas Dreßler [Sun, 14 Apr 2019 16:32:37 +0000 (18:32 +0200)]
st: Replace global grabs with input device grabs

Global grabs are being removed from Clutter in favour of input device
grabs, so only grab the input device instead and replace priv->grabbed
with checks for priv->grab_device.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/495

7 years agolookingGlass: Replace global grabs with input device grabs
Jonas Dreßler [Sun, 14 Apr 2019 16:32:11 +0000 (18:32 +0200)]
lookingGlass: Replace global grabs with input device grabs

Global grabs are being removed from Clutter in favour of input device
grabs.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/495

7 years agokeyboard: Remove unused keyboard gsetting schema
Sonny Piers [Sun, 30 Jun 2019 22:17:40 +0000 (00:17 +0200)]
keyboard: Remove unused keyboard gsetting schema

Since commit 7fd8fa34, the schema is no longer used.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/604

7 years agostyle: Use camelCase for variable names
Florian Müllner [Thu, 31 Jan 2019 13:43:52 +0000 (14:43 +0100)]
style: Use camelCase for variable names

Spotted by eslint.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/607

7 years agostyle: Fix brace style
Florian Müllner [Tue, 29 Jan 2019 21:02:57 +0000 (22:02 +0100)]
style: Fix brace style

Opening braces should be on the same line as the associated statement,
and only be omitted if both surrounding blocks are one-liners.

Partially spotted by eslint.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/607

7 years agostyle: Fix stray/missing spaces
Florian Müllner [Tue, 29 Jan 2019 01:27:05 +0000 (02:27 +0100)]
style: Fix stray/missing spaces

Spotted by eslint.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/607

7 years agostyle: Fix stray/missing semi-colons
Florian Müllner [Tue, 29 Jan 2019 01:18:52 +0000 (02:18 +0100)]
style: Fix stray/missing semi-colons

Spotted by eslint.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/607

7 years agostyle: Avoid trailing commas in array destructuring
Florian Müllner [Tue, 29 Jan 2019 19:20:09 +0000 (20:20 +0100)]
style: Avoid trailing commas in array destructuring

When destructuring multiple return values, we often use trailing commas
to indicate that there are additional elements that we are ignoring.

There isn't anything inherently wrong with that, but it's a style that's
too confusing for eslint - on the one hand we require a space after a
comma, on the other hand we require no space before closing brackets.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/607

7 years agostyle: Use space after catch
Florian Müllner [Tue, 29 Jan 2019 01:26:39 +0000 (02:26 +0100)]
style: Use space after catch

We are currently inconsistent with whether or not to put a space
after catch clauses. While the predominant style is to omit it,
that's inconsistent with the style we use for any other statement.
There's not really a good reason to stick with it, so switch to
the style gjs/eslint default to.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/607

7 years agocleanup: Avoid variable declarations in case clauses
Florian Müllner [Tue, 29 Jan 2019 23:22:10 +0000 (00:22 +0100)]
cleanup: Avoid variable declarations in case clauses

While allowed by the syntax, they are problematic because the
variable is in the scope of the switch() statement, but only
valid if a particular case clause is reached.

Add braces to limit the variables' scope to the corresponding
case clause to avoid that problem.

Spotted by eslint.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/607

7 years agocleanup: Avoid implicit coercion
Florian Müllner [Tue, 29 Jan 2019 23:01:21 +0000 (00:01 +0100)]
cleanup: Avoid implicit coercion

Converting a variable to a particular type can be done explicitly (with
functions like Number() or toString()) or implicitly by relying on type
coercion (like concatenating a variable to the empty string to force
a string, or multiplying it with 1 to force a number).

As those tend to be less readable and clear, they are best avoided. So
replace the cases of string coercion we use with template strings, and
clarify the places that can be confused with number coercion.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/607

7 years agocleanup: Remove unused variables
Florian Müllner [Thu, 31 Jan 2019 14:04:56 +0000 (15:04 +0100)]
cleanup: Remove unused variables

Spotted by eslint.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/607

7 years agocleanup: Remove unneeded escapes in regex
Florian Müllner [Tue, 29 Jan 2019 22:44:38 +0000 (23:44 +0100)]
cleanup: Remove unneeded escapes in regex

. and ) lose their special meaning in character sets, so they don't
need escaping. The same applies to - when it isn't part of a range.

Spotted by eslint.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/607

7 years agocleanup: Use rest operator to handle overly long argument lists
Florian Müllner [Fri, 1 Feb 2019 13:36:37 +0000 (14:36 +0100)]
cleanup: Use rest operator to handle overly long argument lists

The existing indentation is bonkers, but there's no good replacement
with that many arguments. So switch to using the rest operator and
array destructuring as an alternative.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/607

7 years agocleanup: Use rest parameters instead of arguments
Florian Müllner [Tue, 12 Feb 2019 11:24:30 +0000 (12:24 +0100)]
cleanup: Use rest parameters instead of arguments

Spotted by eslint.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/607

7 years agocleanup: Clean up unused imports
Florian Müllner [Sat, 29 Jun 2019 12:27:03 +0000 (14:27 +0200)]
cleanup: Clean up unused imports

Spotted by eslint.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/607

7 years agocleanup: Use Array.includes() to check for element existence
Florian Müllner [Sat, 14 Jul 2018 20:56:22 +0000 (22:56 +0200)]
cleanup: Use Array.includes() to check for element existence

We can use that newer method where we don't care about the actual position
of an element inside the array.

(Array.includes() and Array.indexOf() do behave differently in edge cases,
for example in the handling of NaN, but those don't matter to us)

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/152

7 years agokeyboard: Remove unnecessary boolean cast
Florian Müllner [Sat, 29 Jun 2019 22:33:20 +0000 (00:33 +0200)]
keyboard: Remove unnecessary boolean cast

In contexts where a statement (like if or while) expects a condition,
any expression will be implicitly cast to boolean already without
C-isms like double negation.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/606

7 years agorunDialog: Don't return from finally block
Florian Müllner [Mon, 4 Feb 2019 12:22:41 +0000 (13:22 +0100)]
runDialog: Don't return from finally block

Control flow statements like return, break or continue are considered
unsafe in finally blocks, as they take precendence over any control
flow statement in the try and catch blocks, which may be unexpected.

This isn't the case here as the statement in the finally block is the
only one, but we can just as well avoid the finally block altogether
and use a regular return statement.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/606

7 years agopopupMenu: Use regular method style
Florian Müllner [Sat, 29 Jun 2019 15:47:33 +0000 (17:47 +0200)]
popupMenu: Use regular method style

We don't define methods on a single line anywhere else, so don't do
that here either for consistency.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/606

7 years agopopupMenu: Use consistent registerClass() style
Florian Müllner [Sat, 29 Jun 2019 13:04:13 +0000 (15:04 +0200)]
popupMenu: Use consistent registerClass() style

We don't add a line break between parameters and class elsewhere,
so be consistent with that.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/606